<!DOCTYPE HTML>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <title>试卷明细添加 - 交通运输人员就业与再就业教育培训平台</title>
    <meta th:replace="~{include/all_include ::  title}"/>
    <link
            th:href="@{/common/resource/H-ui.admin/static/h-ui.admin/css/H-ui.login.css}"
            rel="stylesheet" type="text/css"/>
    <meta name="keywords" content="交通运输人员就业与再就业教育培训平台-登录">
    <meta name="description" content="交通运输人员就业与再就业教育培训平台-登录">
</head>
<body>
<nav class="breadcrumb">
    <i class="Hui-iconfont">&#xe67f;</i> 首页
    <span class="c-gray en">&gt;</span>资料管理模块
    <span class="c-gray en">&gt;</span> 试卷明细添加
    <a class="btn btn-success radius r" style="line-height: 1.6em; margin-top: 3px"
       href="javascript:location.replace(location.href);" title="刷新">
        <i class="Hui-iconfont">&#xe68f;</i>
    </a>
</nav>
<div class="page-container">
    <div class="mt-20">
        <div id="DataTables_Table_0_wrapper"
             class="dataTables_wrapper no-footer">
            <form id="formId" method="post" th:action="@{/back/train/examDetailInsertSubmit}">
                <!--<button name="" id="" class="btn btn-success" type="submit">
                    批量保存
                </button>-->
                <table
                        class="table table-border table-bordered table-bg table-hover table-sort table-responsive">
                    <thead>
                    <tr class="text-c">
                        <th width="90">Id</th>
                        <th width="90">名称</th>
                        <th width="90">类型</th>
                        <th width="80">难易程度</th>
                        <th width="80">分数</th>
                    </tr>
                    </thead>
                    <tbody>
                    <th:block th:each="oneTemp : ${examDetailList }">
                        <input type="hidden" name="id" th:value="${oneTemp.id}"/>
                        <input type="hidden" name="examId" th:value="${oneTemp.examId}"/>
                        <input type="hidden" name="askId" th:value="${oneTemp.askId}"/>
                        <input type="hidden" name="askType" th:value="${oneTemp.askType}"/>
                        <input type="hidden" name="hardStar" th:value="${oneTemp.hardStar}"/>
                        <input type="hidden" name="score" th:value="${oneTemp.score}"/>
                        <input type="hidden" name="name" th:value="${oneTemp.name}"/>
                        <tr class="text-c">
                            <td th:text="${oneTemp.id }">
                            </td>
                            <td class="text-l">
                                <u style="cursor: pointer" class="text-primary" data-title="试卷明细查看" title="试卷明细查看"
                                   th:data-href="@{/back/train/examDetailUpdate('entity.id'=${oneTemp.id })}"
                                   onclick="Hui_admin_tab(this)"
                                   th:text="${oneTemp.name }">
                                </u>
                            </td>
                            <td th:text="${oneTemp.askTypeStr }">
                            </td>
                            <td th:text="${oneTemp.hardStar }">
                            </td>
                            <td th:text="${oneTemp.score }">
                            </td>
                        </tr>
                    </th:block>
                    </tbody>
                </table>
            </form>
        </div>
    </div>
</div>
<footer th:replace="~{include/all_include ::  footer}"/>

<!--请在下方写此页面业务相关的脚本-->
<script type="text/javascript"
        th:src="@{/common/resource/H-ui.admin/lib/My97DatePicker/4.8/WdatePicker.js }"></script>
<script type="text/javascript"
        th:src="@{/common/resource/H-ui.admin/lib/datatables/1.10.15/jquery.dataTables.min.js}"></script>
<script type="text/javascript" th:src="@{/common/resource/H-ui.admin/lib/laypage/1.2/laypage.js}"></script>

<!--请在下方写此页面业务相关的脚本-->
<script type="text/javascript" th:src="@{/common/resource/H-ui.admin/lib/jquery.validation/1.14.0/jquery.validate.js}"></script>
<script type="text/javascript" th:src="@{/common/resource/H-ui.admin/lib/jquery.validation/1.14.0/validate-methods.js}"></script>
<script type="text/javascript" th:src="@{/common/resource/H-ui.admin/lib/jquery.validation/1.14.0/messages_zh.js}"></script>
<script type="text/javascript" th:src="@{/common/resource/H-ui.admin/lib/webuploader/0.1.5/webuploader.min.js}"></script>
<script type="text/javascript" th:src="@{/common/resource/H-ui.admin/lib/ueditor/1.4.3/ueditor.config.js}"></script>
<script type="text/javascript" th:src="@{/common/resource/H-ui.admin/lib/ueditor/1.4.3/ueditor.all.min.js}"> </script>
<script type="text/javascript" th:src="@{/common/resource/H-ui.admin/lib/ueditor/1.4.3/lang/zh-cn/zh-cn.js}"></script>
<script type="text/javascript" th:inline="javascript">
    $(function(){
        $('.skin-minimal input').iCheck({
            checkboxClass: 'icheckbox-blue',
            radioClass: 'iradio-blue',
            increaseArea: '20%'
        });

        //表单验证
        $("#formId").validate({
            rules:{
                'entity.edYear':{
                    required:true,
                    number:true,
                }
            },
            onkeyup:false,
            focusCleanup:true,
            success:"valid",
            submitHandler:function(form){
                $(form).ajaxSubmit({
                    type: 'post',
                    success: function(data){
                        console.log("==data==",data)
                        data = JSON.parse(data);
                        layer.msg(data.info,{icon:1,time:3000},function(){
                            /* 关闭当前窗口 */
                            if (data.code == '0') {
                                var index = parent.layer.getFrameIndex(window.name);
                                parent.$('.btn-refresh').click();
                                parent.layer.close(index);
                            }
                        });
                    },
                    error: function(XmlHttpRequest, textStatus, errorThrown){
                        layer.msg('error!',{icon:1,time:1000});
                    }
                });
            }
        });
    });
</script>
</body>
</html>